#include <stdio.h>
#include <stdlib.h>
#define MAX_BITREE_SIZE 20

typedef struct BiTNode
{
	char data;
	struct BiTNode *lchild, *rchild;
}BiTNode, *BiTree;

void Create_BiTree(BiTree *T)
{
	char ch;
	ch=getchar();
	if(ch=='@') *T=NULL;
	else
	{
		*T=(BiTree)malloc(sizeof(BiTNode));
		(*T)->data=ch;
		Create_BiTree(&(*T)->lchild);
		Create_BiTree(&(*T)->rchild);
	}
}

void PreOrder(BiTree T)
{ 
	if(T)//
	{
		printf("%c",T->data);//
		PreOrder(T->lchild);//
		PreOrder(T->rchild);//
	}
}

void InOrder(BiTree T)
{
	if(T)//
	{
		InOrder(T->lchild);//
		printf("%c",T->data);//
		InOrder(T->rchild);//
	}
}

void PostOrder(BiTree T)
{
	if(T)
	{
		PostOrder(T->lchild);//
		PostOrder(T->rchild);//
		printf("%c",T->data);//
	}
}

main()
{
	BiTree T;//
	printf("\ninput PreOrder str : ");
	Create_BiTree(&T);//
	printf("\n");
	printf("\nPreOrder  list of T : ");
	PreOrder(T);//
	printf("\nInOrder   list of T : ");
	InOrder(T);//
	printf("\nPostOrder list of T : ");
	PostOrder(T);//
	printf("\n ");
}